package pers.qianyu.diytomcat.util;

import cn.hutool.core.io.*;
import org.jsoup.*;
import org.jsoup.nodes.*;
import pers.qianyu.diytomcat.constants.*;

/**
 * @author mizzle rain
 * @date 2021-01-08 14:24
 */
public class ContextXmlUtil {
    public static String getWatchedResource() {
        try {
            String xml = FileUtil.readUtf8String(Locations.CONTEXT_XML);
            Document document = Jsoup.parse(xml);
            return document.select("WatchedResource").first().text();
        } catch (Exception e) {
            e.printStackTrace();
            return "WEB-INF/web.xml";
        }
    }
}
